<!-- 父组件 -->
<template>
    <div>
        <h3>App</h3>
        <button @click="fn">子组件加{{num}}</button>
        <hr>
        <Child></Child>
    </div>
</template>

<script>
import Child from '@/components/Child.vue'

export default {
    components: {Child},
    data(){
      return {
          num:2
      }
    },
    methods: {
        fn(){
            this.$bus.$emit('addNum',this.num)
        }
    }
}
</script>